<template>
	<view class="container">
         <view class="red-box"></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			nickname: '',
			userinfo:'',
		};
	},
	onShow() {
		this.tui.haslogin();
		this.userinfo = this.tui.getUserInfoData();
		
		this.nickname=this.userinfo.nick_name;
	},
	methods: {
		
		nickename(){
			let token = this.tui.getToken();
			let datas={
				token:token,
				up_type:2,
				nick_name:this.nickname
			};
			let nicknames=this.tui.request('user','post',datas,1000,1,'','updateUserInfo');
			Promise.resolve(nicknames).then((value)=>{
			   if(value.code==10000){
			   	this.tui.toast(value.message);
			   }else{
			   	this.tui.toast(value.message);
			   }
			})
		},
		inputNickname(e) {
			this.nickname = e.detail.value;
		},
		clearInput() {
			this.nickname = '';
		}
	}
};
</script>

<style lang="scss">
	.red-box{
		background:url('/static/images/red/redbg.jpg') top left no-repeat;
		background-size: 100%;
		height: 2000rpx;

	}
.container {
background: #91111e;
	.tui-cell-input {
		width: 100%;
		display: flex;
		align-items: center;
		box-sizing: border-box;
		
		input {
			flex: 1;
			padding-left: $uni-spacing-row-base;
		}
	}
	.tui-btn-box {
		padding: 40rpx 30rpx 10rpx 30rpx;
		box-sizing: border-box;
	}
}
</style>
